// 应用于select数据格式化，map参数格式为{label: '', value: ''}
export const selectFormat = {
  coverTree: function coverTree (treeList, map) {
    const newTreeList = []
    treeList.forEach((item) => {
      const value = item[map.value]
      const label = item[map.label]
      let children = item[map.children]
      if (children && children.length !== 0) {
        children = coverTree(children, map)
      } else {
        children = ''
      }
      newTreeList.push({
        value,
        label,
        children
      })
    })
    return newTreeList
  },
  convertTree1:function  convertTree1(all) {

  }
}
